#pragma once
#include "EpilValueObject.h"


class EpilNilObject;
class EpilNumberObject;
class EpilStringObject;



class EpilBooleanObject : public EpilValueObject
{
	EPIL_OBJECT_DECL( Boolean );

public:
	EpilBooleanObject( EpilInterpreter * interpreter, bool value );
	virtual ~EpilBooleanObject();

	bool								GetValue() const								{ return m_value; }

	EpilObject *						OperateUnary( EpilUnaryOperator op );
	EpilObject *						OperateBinary( EpilBinaryOperator op, EpilObject * that );

	bool								operator==( bool rhs ) const;
	bool								operator==( const EpilObject & rhs ) const;
	bool								operator==( const EpilBooleanObject & rhs ) const;

	virtual EpilValueObject *			Clone() const;
	virtual tstring						ToString() const;

private:
	EpilObject *						OperateBinaryInternal( EpilBinaryOperator op, EpilNilObject * that );
	EpilObject *						OperateBinaryInternal( EpilBinaryOperator op, EpilBooleanObject * that );
	EpilObject *						OperateBinaryInternal( EpilBinaryOperator op, EpilNumberObject * that );
	EpilObject *						OperateBinaryInternal( EpilBinaryOperator op, EpilStringObject * that );

	bool								m_value;
};
